﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VICC_GLLG
    {
        public DataRow Convert2ICC_GLLG(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryICC_GLLG(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["ICCDAT"] = " ".PadRight(0 ); 
         dwReturn["GLMANDANT"] = " ".PadRight(2 ); 
         dwReturn["GLPARTIE"] = " ".PadRight(7 ); 
         dwReturn["GLPARTIEKZ"] = " ".PadRight(1 ); 
         dwReturn["GLLO"] = " ".PadRight(2 ); 
         dwReturn["GLLB"] = " ".PadRight(2 ); 
         dwReturn["GLLP"] = " ".PadRight(8 ); 
         dwReturn["GLLBEH"] = " ".PadRight(10 ); 
         dwReturn["GLLBEHI"] = " ".PadRight(10 ); 
         dwReturn["GLBSTKG"] = " ".PadRight(0 ); 
         dwReturn["GLBSTKA"] = " ".PadRight(0 ); 
         dwReturn["GLBSTSP"] = " ".PadRight(0 ); 
         dwReturn["GLBSTNET"] = " ".PadRight(0 ); 
         dwReturn["GLTARA"] = " ".PadRight(0 ); 
         dwReturn["GLHUELGEW"] = " ".PadRight(0 ); 
         dwReturn["GLENTDAT"] = " ".PadRight(0 ); 
         dwReturn["GLENTZEIT"] = " ".PadRight(0 ); 
         dwReturn["GLBEM"] = " ".PadRight(40 ); 
         dwReturn["GLAENDZL"] = " ".PadRight(0 ); 
         dwReturn["GLAUFBKZ"] = " ".PadRight(1 ); 
         dwReturn["GLTEILNR"] = " ".PadRight(4 ); 
         dwReturn["GLABZUGKZ1"] = " ".PadRight(1 ); 
         dwReturn["GLABZUGKZ2"] = " ".PadRight(1 ); 
         dwReturn["GLABZUGKZ3"] = " ".PadRight(1 ); 
         dwReturn["GLABZUGKZ4"] = " ".PadRight(1 ); 
         dwReturn["GLINVDAT"] = " ".PadRight(0 ); 
         dwReturn["GLHUELTYP"] = " ".PadRight(6 ); 
         dwReturn["GLLAENGE"] = " ".PadRight(0 ); 
         dwReturn["GLAUFMSL"] = " ".PadRight(2 ); 
         dwReturn["GLSPSTA"] = " ".PadRight(2 ); 
         dwReturn["GLSPGRD"] = " ".PadRight(2 ); 
         dwReturn["GLSPDAT"] = " ".PadRight(0 ); 
         dwReturn["GLPSTART"] = " ".PadRight(4 ); 
         dwReturn["GLPACKNR"] = " ".PadRight(4 ); 
         dwReturn["GLURLB"] = " ".PadRight(2 ); 
         dwReturn["GLURLP"] = " ".PadRight(8 ); 
         dwReturn["GLURAKZ"] = " ".PadRight(1 ); 
         dwReturn["GLZUSTAND"] = " ".PadRight(4 ); 
         dwReturn["GLUBDAT"] = " ".PadRight(0 ); 
         dwReturn["GLUBZEIT"] = " ".PadRight(0 ); 
         dwReturn["GLOWNER"] = " ".PadRight(8 ); 
         dwReturn["GLINVOICE"] = " ".PadRight(8 ); 
         dwReturn["GLINVOICEPOS"] = " ".PadRight(3 ); 
         dwReturn["GLPRODLO"] = " ".PadRight(2 ); 
         dwReturn["GLPRODDAT"] = " ".PadRight(0 ); 
         dwReturn["GLKOND"] = " ".PadRight(0 ); 
         dwReturn["GLTEXTSL"] = " ".PadRight(2 ); 
         dwReturn["GLCARRIER"] = " ".PadRight(8 ); 
         dwReturn["GLCARRPOS"] = " ".PadRight(3 ); 
         dwReturn["GLCARRNOPA"] = " ".PadRight(0 ); 
         dwReturn["GLURLAND"] = " ".PadRight(3 ); 
         dwReturn["GLVERZKZ"] = " ".PadRight(1 ); 
         dwReturn["GLMNRKRS"] = " ".PadRight(2 ); 
         dwReturn["GLMLFDNR"] = " ".PadRight(4 ); 
         dwReturn["GLMPOS"] = " ".PadRight(2 ); 
         dwReturn["GLSCHICHT"] = " ".PadRight(1 ); 
         dwReturn["GLKONDKZ"] = " ".PadRight(1 ); 
         dwReturn["GLIKOND"] = " ".PadRight(0 ); 
         dwReturn["GLPOSTYP"] = " ".PadRight(3 ); 
         dwReturn["GLFILLER1"] = " ".PadRight(39 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapICC_GLLG(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveICC_GLLG(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryICC_GLLG(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapICC_GLLG(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertICC_GLLG(dwLocal, ITXDBVERSION);
            }
            UpdateICC_GLLG(dwLocal);
        }
        public void InsertICC_GLLG(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO ICC_GLLG(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryICC_GLLG(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM ICC_GLLG WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    or1.CommandText = "SELECT 'ÆÚ³õ' as TYP,ICCDAT,GLMANDANT,GLPARTIE,GLPARTIEKZ, "
                        + " GLLO,GLLB,GLLP,GLLBEH,GLLBEHI,GLBSTKG,GLBSTKA,GLBSTSP, "
                        + " GLBSTNET,GLTARA,GLHUELGEW,GLENTDAT,GLENTZEIT,GLBEM,GLAENDZL,GLAUFBKZ,GLTEILNR,GLABZUGKZ1, "
                        + " GLABZUGKZ2,GLABZUGKZ3,GLABZUGKZ4,GLINVDAT,GLHUELTYP,GLLAENGE,GLAUFMSL,GLSPSTA,GLSPGRD,GLSPDAT, "
                        + " GLPSTART,GLPACKNR,GLURLB,GLURLP,GLURAKZ,GLZUSTAND,GLUBDAT,GLUBZEIT,GLOWNER,GLINVOICE,GLINVOICEPOS, "
                        + " GLPRODLO,GLPRODDAT,GLKOND,GLTEXTSL,GLCARRIER,GLCARRPOS,GLCARRNOPA,GLURLAND,GLVERZKZ,GLMNRKRS, "
                        + " GLMLFDNR,GLMPOS,GLSCHICHT,GLKONDKZ,GLIKOND,GLPOSTYP,GLFILLER1 "
                        + " FROM ICC_GLLG WHERE ICCDAT=:ICCDAT: AND GLMANDANT = :GLMANDANT: AND GLPARTIE = :GLPARTIE: "
                        + " AND GLLO = :GLLO: AND GLLB = :GLLB: "
                        + " union all "
                        + " SELECT 'ÆÚÄ©' AS TYP,TO_NUMBER(to_char(to_date(ICCDAT,'yyyymmdd')-1,'yyyymmdd')) as ICCDAT,GLMANDANT,GLPARTIE,GLPARTIEKZ, "
                        + " GLLO,GLLB,GLLP,GLLBEH,GLLBEHI,GLBSTKG,GLBSTKA,GLBSTSP, "
                        + " GLBSTNET,GLTARA,GLHUELGEW,GLENTDAT,GLENTZEIT,GLBEM,GLAENDZL,GLAUFBKZ,GLTEILNR,GLABZUGKZ1, "
                        + " GLABZUGKZ2,GLABZUGKZ3,GLABZUGKZ4,GLINVDAT,GLHUELTYP,GLLAENGE,GLAUFMSL,GLSPSTA,GLSPGRD,GLSPDAT, "
                        + " GLPSTART,GLPACKNR,GLURLB,GLURLP,GLURAKZ,GLZUSTAND,GLUBDAT,GLUBZEIT,GLOWNER,GLINVOICE,GLINVOICEPOS, "
                        + " GLPRODLO,GLPRODDAT,GLKOND,GLTEXTSL,GLCARRIER,GLCARRPOS,GLCARRNOPA,GLURLAND,GLVERZKZ,GLMNRKRS, "
                        + " GLMLFDNR,GLMPOS,GLSCHICHT,GLKONDKZ,GLIKOND,GLPOSTYP,GLFILLER1 "
                        + " FROM ICC_GLLG WHERE ICCDAT=:GLPRODDAT: AND GLMANDANT = :GLMANDANT: AND GLPARTIE = :GLPARTIE: "
                        + " AND GLLO = :GLLO: AND GLLB = :GLLB: "
                        + " ORDER BY TYP,ICCDAT,GLPARTIE,GLLBEHI ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;

                case 99:
                    or1.CommandText = "SELECT * FROM ICC_GLLG  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "ICC_GLLG";
            Return = Result;
            return Return;
        }
        public void DeleteICC_GLLG(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ICC_GLLG   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateICC_GLLG(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE ICC_GLLG SET "
                    +"ICCDAT= :ICCDAT,"
                    +"GLMANDANT= :GLMANDANT,"
                    +"GLPARTIE= :GLPARTIE,"
                    +"GLPARTIEKZ= :GLPARTIEKZ,"
                    +"GLLO= :GLLO,"
                    +"GLLB= :GLLB,"
                    +"GLLP= :GLLP,"
                    +"GLLBEH= :GLLBEH,"
                    +"GLLBEHI= :GLLBEHI,"
                    +"GLBSTKG= :GLBSTKG,"
                    +"GLBSTKA= :GLBSTKA,"
                    +"GLBSTSP= :GLBSTSP,"
                    +"GLBSTNET= :GLBSTNET,"
                    +"GLTARA= :GLTARA,"
                    +"GLHUELGEW= :GLHUELGEW,"
                    +"GLENTDAT= :GLENTDAT,"
                    +"GLENTZEIT= :GLENTZEIT,"
                    +"GLBEM= :GLBEM,"
                    +"GLAENDZL= :GLAENDZL,"
                    +"GLAUFBKZ= :GLAUFBKZ,"
                    +"GLTEILNR= :GLTEILNR,"
                    +"GLABZUGKZ1= :GLABZUGKZ1,"
                    +"GLABZUGKZ2= :GLABZUGKZ2,"
                    +"GLABZUGKZ3= :GLABZUGKZ3,"
                    +"GLABZUGKZ4= :GLABZUGKZ4,"
                    +"GLINVDAT= :GLINVDAT,"
                    +"GLHUELTYP= :GLHUELTYP,"
                    +"GLLAENGE= :GLLAENGE,"
                    +"GLAUFMSL= :GLAUFMSL,"
                    +"GLSPSTA= :GLSPSTA,"
                    +"GLSPGRD= :GLSPGRD,"
                    +"GLSPDAT= :GLSPDAT,"
                    +"GLPSTART= :GLPSTART,"
                    +"GLPACKNR= :GLPACKNR,"
                    +"GLURLB= :GLURLB,"
                    +"GLURLP= :GLURLP,"
                    +"GLURAKZ= :GLURAKZ,"
                    +"GLZUSTAND= :GLZUSTAND,"
                    +"GLUBDAT= :GLUBDAT,"
                    +"GLUBZEIT= :GLUBZEIT,"
                    +"GLOWNER= :GLOWNER,"
                    +"GLINVOICE= :GLINVOICE,"
                    +"GLINVOICEPOS= :GLINVOICEPOS,"
                    +"GLPRODLO= :GLPRODLO,"
                    +"GLPRODDAT= :GLPRODDAT,"
                    +"GLKOND= :GLKOND,"
                    +"GLTEXTSL= :GLTEXTSL,"
                    +"GLCARRIER= :GLCARRIER,"
                    +"GLCARRPOS= :GLCARRPOS,"
                    +"GLCARRNOPA= :GLCARRNOPA,"
                    +"GLURLAND= :GLURLAND,"
                    +"GLVERZKZ= :GLVERZKZ,"
                    +"GLMNRKRS= :GLMNRKRS,"
                    +"GLMLFDNR= :GLMLFDNR,"
                    +"GLMPOS= :GLMPOS,"
                    +"GLSCHICHT= :GLSCHICHT,"
                    +"GLKONDKZ= :GLKONDKZ,"
                    +"GLIKOND= :GLIKOND,"
                    +"GLPOSTYP= :GLPOSTYP,"
                    +"GLFILLER1= :GLFILLER1,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("ICCDAT", OracleType.NVarChar).Value = dwData["ICCDAT"].ToString(); 
          or1.Parameters.Add("GLMANDANT", OracleType.NVarChar).Value = dwData["GLMANDANT"].ToString(); 
          or1.Parameters.Add("GLPARTIE", OracleType.NVarChar).Value = dwData["GLPARTIE"].ToString(); 
          or1.Parameters.Add("GLPARTIEKZ", OracleType.NVarChar).Value = dwData["GLPARTIEKZ"].ToString(); 
          or1.Parameters.Add("GLLO", OracleType.NVarChar).Value = dwData["GLLO"].ToString(); 
          or1.Parameters.Add("GLLB", OracleType.NVarChar).Value = dwData["GLLB"].ToString(); 
          or1.Parameters.Add("GLLP", OracleType.NVarChar).Value = dwData["GLLP"].ToString(); 
          or1.Parameters.Add("GLLBEH", OracleType.NVarChar).Value = dwData["GLLBEH"].ToString(); 
          or1.Parameters.Add("GLLBEHI", OracleType.NVarChar).Value = dwData["GLLBEHI"].ToString(); 
          or1.Parameters.Add("GLBSTKG", OracleType.NVarChar).Value = dwData["GLBSTKG"].ToString(); 
          or1.Parameters.Add("GLBSTKA", OracleType.NVarChar).Value = dwData["GLBSTKA"].ToString(); 
          or1.Parameters.Add("GLBSTSP", OracleType.NVarChar).Value = dwData["GLBSTSP"].ToString(); 
          or1.Parameters.Add("GLBSTNET", OracleType.NVarChar).Value = dwData["GLBSTNET"].ToString(); 
          or1.Parameters.Add("GLTARA", OracleType.NVarChar).Value = dwData["GLTARA"].ToString(); 
          or1.Parameters.Add("GLHUELGEW", OracleType.NVarChar).Value = dwData["GLHUELGEW"].ToString(); 
          or1.Parameters.Add("GLENTDAT", OracleType.NVarChar).Value = dwData["GLENTDAT"].ToString(); 
          or1.Parameters.Add("GLENTZEIT", OracleType.NVarChar).Value = dwData["GLENTZEIT"].ToString(); 
          or1.Parameters.Add("GLBEM", OracleType.NVarChar).Value = dwData["GLBEM"].ToString(); 
          or1.Parameters.Add("GLAENDZL", OracleType.NVarChar).Value = dwData["GLAENDZL"].ToString(); 
          or1.Parameters.Add("GLAUFBKZ", OracleType.NVarChar).Value = dwData["GLAUFBKZ"].ToString(); 
          or1.Parameters.Add("GLTEILNR", OracleType.NVarChar).Value = dwData["GLTEILNR"].ToString(); 
          or1.Parameters.Add("GLABZUGKZ1", OracleType.NVarChar).Value = dwData["GLABZUGKZ1"].ToString(); 
          or1.Parameters.Add("GLABZUGKZ2", OracleType.NVarChar).Value = dwData["GLABZUGKZ2"].ToString(); 
          or1.Parameters.Add("GLABZUGKZ3", OracleType.NVarChar).Value = dwData["GLABZUGKZ3"].ToString(); 
          or1.Parameters.Add("GLABZUGKZ4", OracleType.NVarChar).Value = dwData["GLABZUGKZ4"].ToString(); 
          or1.Parameters.Add("GLINVDAT", OracleType.NVarChar).Value = dwData["GLINVDAT"].ToString(); 
          or1.Parameters.Add("GLHUELTYP", OracleType.NVarChar).Value = dwData["GLHUELTYP"].ToString(); 
          or1.Parameters.Add("GLLAENGE", OracleType.NVarChar).Value = dwData["GLLAENGE"].ToString(); 
          or1.Parameters.Add("GLAUFMSL", OracleType.NVarChar).Value = dwData["GLAUFMSL"].ToString(); 
          or1.Parameters.Add("GLSPSTA", OracleType.NVarChar).Value = dwData["GLSPSTA"].ToString(); 
          or1.Parameters.Add("GLSPGRD", OracleType.NVarChar).Value = dwData["GLSPGRD"].ToString(); 
          or1.Parameters.Add("GLSPDAT", OracleType.NVarChar).Value = dwData["GLSPDAT"].ToString(); 
          or1.Parameters.Add("GLPSTART", OracleType.NVarChar).Value = dwData["GLPSTART"].ToString(); 
          or1.Parameters.Add("GLPACKNR", OracleType.NVarChar).Value = dwData["GLPACKNR"].ToString(); 
          or1.Parameters.Add("GLURLB", OracleType.NVarChar).Value = dwData["GLURLB"].ToString(); 
          or1.Parameters.Add("GLURLP", OracleType.NVarChar).Value = dwData["GLURLP"].ToString(); 
          or1.Parameters.Add("GLURAKZ", OracleType.NVarChar).Value = dwData["GLURAKZ"].ToString(); 
          or1.Parameters.Add("GLZUSTAND", OracleType.NVarChar).Value = dwData["GLZUSTAND"].ToString(); 
          or1.Parameters.Add("GLUBDAT", OracleType.NVarChar).Value = dwData["GLUBDAT"].ToString(); 
          or1.Parameters.Add("GLUBZEIT", OracleType.NVarChar).Value = dwData["GLUBZEIT"].ToString(); 
          or1.Parameters.Add("GLOWNER", OracleType.NVarChar).Value = dwData["GLOWNER"].ToString(); 
          or1.Parameters.Add("GLINVOICE", OracleType.NVarChar).Value = dwData["GLINVOICE"].ToString(); 
          or1.Parameters.Add("GLINVOICEPOS", OracleType.NVarChar).Value = dwData["GLINVOICEPOS"].ToString(); 
          or1.Parameters.Add("GLPRODLO", OracleType.NVarChar).Value = dwData["GLPRODLO"].ToString(); 
          or1.Parameters.Add("GLPRODDAT", OracleType.NVarChar).Value = dwData["GLPRODDAT"].ToString(); 
          or1.Parameters.Add("GLKOND", OracleType.NVarChar).Value = dwData["GLKOND"].ToString(); 
          or1.Parameters.Add("GLTEXTSL", OracleType.NVarChar).Value = dwData["GLTEXTSL"].ToString(); 
          or1.Parameters.Add("GLCARRIER", OracleType.NVarChar).Value = dwData["GLCARRIER"].ToString(); 
          or1.Parameters.Add("GLCARRPOS", OracleType.NVarChar).Value = dwData["GLCARRPOS"].ToString(); 
          or1.Parameters.Add("GLCARRNOPA", OracleType.NVarChar).Value = dwData["GLCARRNOPA"].ToString(); 
          or1.Parameters.Add("GLURLAND", OracleType.NVarChar).Value = dwData["GLURLAND"].ToString(); 
          or1.Parameters.Add("GLVERZKZ", OracleType.NVarChar).Value = dwData["GLVERZKZ"].ToString(); 
          or1.Parameters.Add("GLMNRKRS", OracleType.NVarChar).Value = dwData["GLMNRKRS"].ToString(); 
          or1.Parameters.Add("GLMLFDNR", OracleType.NVarChar).Value = dwData["GLMLFDNR"].ToString(); 
          or1.Parameters.Add("GLMPOS", OracleType.NVarChar).Value = dwData["GLMPOS"].ToString(); 
          or1.Parameters.Add("GLSCHICHT", OracleType.NVarChar).Value = dwData["GLSCHICHT"].ToString(); 
          or1.Parameters.Add("GLKONDKZ", OracleType.NVarChar).Value = dwData["GLKONDKZ"].ToString(); 
          or1.Parameters.Add("GLIKOND", OracleType.NVarChar).Value = dwData["GLIKOND"].ToString(); 
          or1.Parameters.Add("GLPOSTYP", OracleType.NVarChar).Value = dwData["GLPOSTYP"].ToString(); 
          or1.Parameters.Add("GLFILLER1", OracleType.NVarChar).Value = dwData["GLFILLER1"].ToString(); 
                    #endregion
                  break;
                case 2:
                  or1.CommandText = "UPDATE ICC_GLLG A SET ICCDAT = :ICCDAT:,GLBSTKG =:GLBSTKG:,GLBSTKA=:GLBSTKA:,GLBSTSP = :GLBSTSP:,GLFILLER1 = :GLFILLER1:,GLCARRIER = :GLCARRIER:,GLBEM = :GLBEM: "
                      + " WHERE ICCDAT = :GLPRODDAT: AND  GLPARTIE =:GLPARTIE: AND GLLBEHI = :GLLBEHI: AND GLCARRIER = :GLOWNER: ";
                  or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                  break;
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
